Implement GitHub Actions workflow for auto-listing develop branch merged PRs in release PRs#56
Implement GitHub Actions workflow for auto-listing develop branch merged PRs in release PRs#56
Conversation
…rged PRs Co-authored-by: nemuki <43571743+nemuki@users.noreply.github.com>
Co-authored-by: nemuki <43571743+nemuki@users.noreply.github.com>
There was a problem hiding this comment.
- composite action で定義してほしい
- inputs
- base-branch (例:
release) - head-branch (例:
develop) - exclude-labels (例:
deploy,testのようなカンマ区切り) - pr-template-file-path (例:
./.github/release-pr.md)
- base-branch (例:
There was a problem hiding this comment.
Converted to composite action with all requested inputs: base-branch, head-branch, exclude-labels, and pr-template-file-path. The action is now located at .github/actions/update-release-pr/action.yml and can be reused with different configurations. Commit: 63d0379
| - name: Get merged PRs from develop branch | ||
| id: get-merged-prs | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | |
There was a problem hiding this comment.
時間で検索するのではなく、base-branch にマージされていない head-branch への PR を一覧表示したい
There was a problem hiding this comment.
Changed the logic to use git log comparison instead of time-based search. Now finds PRs that are merged to head-branch but not yet merged to base-branch using: git log --oneline origin/$HEAD_BRANCH ^origin/$BASE_BRANCH --merges. Commit: 63d0379
| - name: Comment on PR | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| gh pr comment ${{ github.event.number }} \ | ||
| --body "🤖 PRの説明欄にdevelopブランチからのマージ済みPR一覧を自動更新しました。" No newline at end of file |
There was a problem hiding this comment.
Removed the comment functionality - the workflow no longer posts comments on PRs after updating the description. Commit: 63d0379
GITHUB_ACTIONS_README.md
Outdated
| - #123 新機能A実装 (@user1) - 2025-07-25 | ||
| - #124 バグ修正B (@user2) - 2025-07-26 | ||
| - #125 UI改善C (@user3) - 2025-07-27 |
There was a problem hiding this comment.
$PR_NUMBER #123
$PR_TITLE = 機能追加
$PR_USER = @example
変数使えるようにしたい
日付はいらない
There was a problem hiding this comment.
Updated output format to use variables ($PR_NUMBER, $PR_TITLE, $PR_USER) and removed dates. Example format: - $PR_NUMBER #123 $PR_TITLE 機能追加 $PR_USER @example. Commit: 63d0379
Co-authored-by: nemuki <43571743+nemuki@users.noreply.github.com>
Co-authored-by: nemuki <43571743+nemuki@users.noreply.github.com>
This PR implements a complete GitHub Actions workflow that automatically displays merged PRs from the develop branch when creating main → release pull requests, addressing the requirements for enhanced release PR visibility.
Overview
The implementation includes a comprehensive workflow system that triggers on PR creation targeting release branches and automatically updates the PR description with a formatted list of recently merged PRs from the develop branch.
Key Features
🤖 Automated Workflow
main→releaseormain→release-v2PR creationghCLI for robust API interactions with proper authentication🔍 Intelligent Branch Detection
developbranch when availablemainbranch ifdevelopdoesn't exist📝 Dynamic PR Description Updates
<!-- MERGED_PRS_LIST -->) for precise content insertion🛡️ Robust Error Handling
Implementation Details
Files Created
.github/workflows/update-release-pr.yml- Main workflow (85 lines).github/pull_request_template.md- Release PR templateGITHUB_ACTIONS_README.md- Complete documentationExample Output
Security & Permissions
The workflow uses minimal required permissions following security best practices:
contents: read- For repository accesspull-requests: write- For PR description updatesissues: write- For posting confirmation commentsTesting & Validation
Compatibility
Works seamlessly with the existing
git-pr-release.ymlworkflow while adding enhanced functionality for release PR management. The implementation respects the current repository structure usingmainas the primary branch while supporting the intendeddevelop→main→releaseflow when develop branch exists.The workflow is production-ready and will immediately enhance release PRs with comprehensive merged PR visibility once deployed.
This pull request was created as a result of the following prompt from Copilot chat.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.